const handleLogin = async () => {
  try {
    const res = await request({
      url: '/api/user/login',
      method: 'POST',
      data: {
        username: form.username,
        password: form.password
      }
    })

    if (res.code === 0) {
      // 保存用户信息
      uni.setStorageSync('userInfo', res.data)
      
      uni.showToast({
        title: '登录成功',
        icon: 'success'
      })
      
      setTimeout(() => {
        uni.navigateBack()
      }, 1500)
    }
  } catch (error) {
    console.error('登录失败:', error)
  }
} 